package com.tuozixuan.camel.rest;

import org.apache.camel.Exchange;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserApi {

	@Autowired
	private UserService userService;
	
	public User getUserById(Exchange exchange) {
		Long id = exchange.getMessage().getHeader("id", Long.class);
		return userService.getUserById(id);
	}
}
